<?php
$this->breadcrumbs=array(
	'訂單管理'=>array('admin'),
	'訂單列表',
);
?>
<style>
td {
	border: solid #68BADA;
	border-width: 0px 1px 1px 0px;
	padding: 5px;
	text-align: center
}
table {
	border: solid #68BADA;
	border-width: 1px 0px 0px 1px;
}
.odd {
	background: none repeat scroll 0 0 #EEEEEE;
}
.even {
	background: none repeat scroll 0 0 #FFFFFF;
}
.three {
	background: none repeat scroll 0 0 #E5F1F4;
}
.jg {
	background: none repeat scroll 0 0 #ADD9ED;
}
.head {
	background: none repeat scroll 0 0 #90D8F0;
}
</style>
<table cellspacing="0" cellpadding="0" width="800" class="tbl">
	<tr class="head">
		<td width="2%">ID</td>
		<td width="10%">訂單編號</td>
		<td width="15%">用戶</td>
		<td width="8%">訂單金額</td>
		<td width="15%">付款方式</td>
		<td width="10%">狀態</td>
		<td width="12%">創建時間</td>
		<td width="12%">更新時間</td>
		<td>操作</td>
	</tr>
	<?php
    $j = 0;
    $k = 0;
    $cssArr = array(0 => 'even', 1 => 'odd', 2 => 'three');
    foreach ($jobs as $job) {
        $i = 0;
        $k++;
        foreach ($job as $item) {
            $trClass = $cssArr[$i % 3];
            $i++;
            $j++;
            ?>
	<tr class="<?= $trClass ?>">
		<td width="5%">
			<?= $j ?>
		</td>
		<td>
			<?= date('m/d', strtotime($item->ShipDate)) ?>
			<br />
			<?= date('l', strtotime($item->ShipDate)) ?>
		</td>
		<td>
			<?php
                    if ($item->ProductionDate) {
                        echo date('m/d', strtotime($item->ProductionDate)) . '<br />';
                        echo date('l', strtotime($item->ProductionDate));
                    }
                    ?>
			&nbsp; </td>
		<td>
			<?= $item->Priority ?>
			&nbsp;</td>
		<td>
			<?= $item->JobNumber ?>
			<br />
			<?= $item->InHouseContract ?>
			<br />
			<?= $item->Description ?>
			<br />
			<?= $item->employees['ProBy'] ?>
		</td>
		<td>
			<?= $item->Artworks ?>
			<br />
			<?= $item->Quantity ?>
			<br />
			<?= $item->Tape ?>
			<br />
			<?= $item->NumberOfLocation ?>
			<br />
			<?= $item->Products ?>
			<br />
			<?= $item->Remark ?>
		</td>
		<td>
			<?= $item->Machine ?>
			<br />
			<?= $item->Zone ?>
			<br />
			<?= $item->Description ?>
			<br />
			<?= $item->MajorStage ?>
			<br />
			<?= $item->Status ?>
		</td>
	</tr>
	<?php
        }
        if ($k < count($jobs)) {
            ?>
	<tr class="jg">
		<td colspan="7">&nbsp;</td>
	</tr>
	<?php
        }
    }
    ?>
</table>
<div id="pager" align="center">
	<?php  
	$this->widget('CLinkPager',array(  
		'header'=>'',  
		'firstPageLabel' => '<<',
		'lastPageLabel' => '>>',
		'prevPageLabel' => '<',
		'nextPageLabel' => '>',
		'pages' => $pages,  
		'maxButtonCount'=>13  
		));  
?>
</div>
